<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>lesson02-homework</title>
</head>

<body>
	<div id="el">
		<p>dog.name:{{dog.name}}</p>
		<button v-on:click="clickHandler">dog.name</button>
	</div>

	<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	<script>
		let vm = new Vue({
			el: '#el',
			data: {
				o: 'object',
				dog: {}
			},
			methods: {
				clickHandler: function () {

					// 该 name 属性是否是响应式的
					//this.dog.name = 'Trump'
					this.$set(this.dog, 'name', 'Trump')

				}
			}
		})
	</script>

</body>

</html>